package pers.fjl.common.po;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import java.time.LocalDate;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 
 * </p>
 *
 * @author fangjiale
 * @since 2021-01-01
 */
@Data
public class Commodity extends Model<Commodity> implements Serializable {

    /**
     * 商品编号
     */
    @TableId(value = "cid", type = IdType.AUTO)
    private String cid;

    /**
     * 名称
     */
    private String cname;

    /**
     * 基础售价
     */
    private Integer price;

    /**
     * 促销开始日期
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
    private LocalDateTime promotionStart;

    /**
     * 促销结束日期
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
    private LocalDateTime promotionEnd;

    /**
     * 折扣价
     */
    private Integer discountPrice;

    /**
     * 库存
     */
    private Integer stock;

    /**
     * 是否可售
     */
    private boolean onSale;

    /**
     * 仓库号
     */
    private String wid;
}
